import request from '@/utils/request/request';
import {
  PasswordStrategyListRes,
  PasswordStrategyParams,
  PasswordStrategyRecord,
} from '@/api/system/model/passwordStrategyModel';

// 分页查询密码策略列表
export function queryPasswordStrategyRecordList(
  params: PasswordStrategyParams
) {
  return request.get<PasswordStrategyListRes>(
    '/api/system/password-strategy/page',
    {
      params,
    }
  );
}

// 新增密码策略
export function addPasswordStrategyRecord(data: PasswordStrategyRecord) {
  return request.post('/api/system/password-strategy', data);
}

// 修改密码策略
export function editPasswordStrategyRecord(data: PasswordStrategyRecord) {
  return request.put('/api/system/password-strategy', data);
}

// 删除密码策略，传id数组，支持批量
export function deletePasswordStrategyRecords(data: any) {
  return request.delete('/api/system/password-strategy', { data }); // 这里data要用{}，否则会报错
}
